<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="animate.js"></script>
    <style>
        .sliderbar{
            width: 100px;
            height: 100px;
            background-color: red;
            position: relative;
        }
        .con{
            width: 260px;
            height: 100px;
            background-color: green;
            position: absolute;
            z-index: -1;
        }
        span{
            font-size: 50px;
            position: absolute;
        }
    </style>
</head>
<body>
    <div class="sliderbar">
        <span><</span>
        <div class="con">问题反馈</div>
    </div>
    <script>
        //1.获取元素
        var sliderbar=document.querySelector('.sliderbar');
        var con=document.querySelector('.con');
        sliderbar.addEventListener('mouseenter',function(){
            animate(con,-160,function(){
                //当我们动画执行完毕,就把⬅改为➡
                sliderbar.children[0].innerHTML='➡';
            });
        })
        sliderbar.addEventListener('mouseleave',function(){
            animate(con,0,function(){
                sliderbar.children[0].innerHTML='⬅';
            });
        })
    </script>
</body>
</html>